import {createRouter, createWebHistory} from 'vue-router'

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [
        {
            path: '/',
            //重定向
            redirect: '/home',
            name: 'layout',
            component: () => import('../layout/layout.vue'),
            children: [
                {
                    path: 'home',
                    name: 'home',
                    component: () => import('../views/Home.vue')
                },
                {
                    path: 'joinClass',
                    name: 'joinClass',
                    component: () => import('../views/joinClass.vue')
                },
                {
                    path:'createClass',
                    name:'createClass',
                    component: () => import('../views/CreateClass.vue')
                },
                {
                    path:'quitClass',
                    name:'quitClass',
                    component: () => import('../views/QuitClass.vue')
                },
                {
                    path:'dismissClass',
                    name:'dismissClass',
                    component: () => import('../views/DismissClass.vue')
                },
                {
                    path:'ClassNotice',
                    name:'ClassNotice',
                    component: () => import('../views/ClassNotice.vue')
                },
                {
                    path:'paymentProject',
                    name:'paymentProject',
                    component: () => import('../views/PaymentProject.vue')
                },
                {
                    path:'classUserManager',
                    name:'classUserManager',
                    component: () => import('../views/ClassUserManager.vue')
                },
                {
                    path:'pay',
                    name:'pay',
                    component: () => import('../views/Pay.vue')
                },
                {
                    path:'classExpenseVariation',
                    name:'classExpenseVariation',
                    component: () => import('../views/ClassExpenseVariation.vue')
                },
                {
                    path:'applyExpense',
                    name:'applyExpense',
                    component: () => import('../views/ApplyExpense.vue')
                },
                {
                    path:'auditApply',
                    name:'auditApply',
                    component: () => import('../views/AuditApply.vue')
                },
            ]
        },
        {
            path: '/login',
            name: 'Login',
            component: () => import('../views/Login.vue')
        },
        {
            path: '/backLogin',
            name: 'backLogin',
            component: () => import('../views/BackLogin.vue')
        },
        {
            path: '/back',
            //重定向
            redirect: '/back/home',
            name: 'backLayout',
            component: () => import('../layout/backLayout.vue'),
            children:[
                {
                    path: 'home',
                    name: 'backHome',
                    component: () => import('../views/BackHome.vue')
                },
                {
                    path: 'backAllNotice',
                    name: 'backAllNotice',
                    component: () => import('../views/BackAllNotice.vue')
                },
                {
                    path: 'backClassNotice',
                    name: 'backClassNotice',
                    component: () => import('../views/BackClassNotice.vue')
                },
                {
                    path: 'backUserManager',
                    name: 'backUserManager',
                    component: () => import('../views/BackUserManager.vue')
                },
                {
                    path: 'backClassManager',
                    name: 'backClassManager',
                    component: () => import('../views/BackClassManager.vue')
                },
            ]
        },
    ]
})
export default router
